package ai.moran.demo.config;

import io.etcd.jetcd.Client;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.net.URI;

/**
 * @author peak
 * @create 2020/6/1 16:56
 */
@Configuration
@Getter
public class EtcdConfig {

    @Value("${etcd.host}")
    private String host;

    //robot
    @Value("${etcd.robot.base}")
    private String robotBase;
    @Value("${etcd.robot.info}")
    private String robotInfo;
    @Value("${etcd.robot.bot}")
    private String robotBot;
    @Value("${etcd.robot.intent}")
    private String robotIntent;
    @Value("${etcd.robot.intentExample}")
    private String robotIntentExample;
    @Value("${etcd.robot.globalConfig}")
    private String robotGlobalConfig;
    @Value("${etcd.robot.qa}")
    private String robotQa;
    @Value("${etcd.robot.variable}")
    private String robotVariable;
    @Value("${etcd.robot.intention}")
    private String robotIntention;


    @Bean
    public Client jClient() {
        return Client.builder().endpoints(new URI[]{URI.create(host)}).build();
    }

}
